package com.kede.app.domain;

import lombok.Data;
import io.swagger.annotations.ApiModelProperty;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import javax.persistence.*;
import javax.validation.constraints.*;
import java.sql.Timestamp;
import java.math.BigDecimal;
import java.io.Serializable;

/**
* @description /
* @author Pr.li
* @date 2023-10-14
**/
@Entity
@Data
@Table(name="t_zhi_good_valid_fail")
public class ZhiGoodValidFail implements Serializable {
    /**
    * 
    */
    @ApiModelProperty(value = "id")
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "`id`")
    private Integer id;
    /**
    * 物品id 关联 zhi_order_goods_list中的id
    */
    @ApiModelProperty(value = "物品id 关联 zhi_order_goods_list中的id")
    @Column(name = "`good_id`",nullable = false)
    @NotNull
    private Integer goodId;
    /**
    * 门店id
    */
    @ApiModelProperty(value = "门店id")
    @Column(name = "`store_id`")
    private Integer storeId;
    /**
    * 物品分类名称
    */
    @ApiModelProperty(value = "物品分类名称")
    @Column(name = "`cate_name`")
    private String cateName;
    /**
    * 置换商品图片
    */
    @ApiModelProperty(value = "置换商品图片")
    @Column(name = "`images`")
    private String images;
    /**
    * 置换商品信息
    */
    @ApiModelProperty(value = "置换商品信息")
    @Column(name = "`message`")
    private String message;
    /**
    * 置换状态1 待确认 2确认失败
    */
    @ApiModelProperty(value = "置换状态1 待确认 2确认失败")
    @Column(name = "`status`")
    private Integer status;
    /**
    * 失败原因
    */
    @ApiModelProperty(value = "失败原因")
    @Column(name = "`reason`")
    private String reason;
    /**
    * 区代理id
    */
    @ApiModelProperty(value = "区代理id")
    @Column(name = "`qu_id`")
    private Integer quId;
    /**
    * 是代理id
    */
    @ApiModelProperty(value = "是代理id")
    @Column(name = "`shi_id`")
    private Integer shiId;
    /**
    * 默认门店价格元
    */
    @ApiModelProperty(value = "默认门店价格元")
    @Column(name = "`default_store_money`",nullable = false)
    @NotNull
    private BigDecimal defaultStoreMoney;
    /**
    * 默认区代价格元
    */
    @ApiModelProperty(value = "默认区代价格元")
    @Column(name = "`default_qu_money`",nullable = false)
    @NotNull
    private BigDecimal defaultQuMoney;
    /**
    * 默认市代价格元
    */
    @ApiModelProperty(value = "默认市代价格元")
    @Column(name = "`default_shi_money`",nullable = false)
    @NotNull
    private BigDecimal defaultShiMoney;
    /**
    * 确认置换时间
    */
    @ApiModelProperty(value = "确认置换时间")
    @Column(name = "`create_time`",nullable = false)
    @NotNull
    private Timestamp createTime;
    /**
    * 验收时间
    */
    @ApiModelProperty(value = "验收时间")
    @Column(name = "`update_time`")
    private Timestamp updateTime;
    /**
    * 运输单id
    */
    @ApiModelProperty(value = "运输单id")
    @Column(name = "`transport_id`",nullable = false)
    @NotNull
    private Integer transportId;

    @Transient
    private String storeName;
    @Transient
    private String quName;
    @Transient
    private String shiName;

    public void copy(ZhiGoodValidFail source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
